<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>

<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page import="modelo.*"%>
<%@page import="DAO.DAOFactory"%>
<%@page import="DAO.FuncionarioDAO"%>



<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
    <title>
      Waiters
    </title>
   
    <link rel="shortcut icon" href="images/icons/icone.png" />
    <link rel="stylesheet" type="text/css" href="css/minified/aui-production.min.css">
    <link id="layout-theme" rel="stylesheet" type="text/css" href="themes/minified/fides/color-schemes/dark-blue.min.css">
    <link rel="stylesheet" type="text/css" href="themes/minified/fides/common.min.css">
    <link rel="stylesheet" type="text/css" href="themes/minified/fides/responsive.min.css">
   
   

    <script type="text/javascript" src="js/minified/aui-production.min.js">
    </script>
	<script>
		function executar(form,operacao){
			form.operacao.value = operacao;
			form.submit();
		}
   	</script>     
     <!--[if lt IE 9]>
      <script src="assets/js/minified/core/html5shiv.min.js">
      </script>
      <script src="assets/js/minified/core/respond.min.js">
      </script>
    <![endif]-->
    <!-- Fides Admin CSS Core -->

  </head>
  
  <body>
    
    <!-- ************************ Barra Preta Menu ************************ -->  
    
    
    <div id="page-wrapper" class="demo-example">
    
        <div id="page-header" class="clearfix"> 
        
        <!-- ************************ Canto esquerdo. Logo ************************ -->  
            <div id="header-logo">
            
            <!-- ************************ Botao de recuar Menu  ************************ -->  
            
                <a href="javascript:;" class="tooltip-button" data-placement="bottom" title="" id="close-sidebar" data-original-title="Fechar Menu">
                <i class="glyph-icon icon-caret-left"></i> </a> <!-- Icone do botao Menu para Esquerda -->
                 
                <a href="javascript:;" class="tooltip-button hidden" data-placement="bottom" title="" id="rm-close-sidebar" data-original-title="Abrir Menu">
                <i class="glyph-icon icon-caret-right"></i> </a> <!-- Icone do botao Menu para Esquerda -->

                <img src="images/logo/logo1.png" width="153" height="46">  <!-- Logo -->
                
            </div>
    
    <!-- ************************ Menu do Lado Direito ************************ -->
        
        <div class="user-profile dropdown"> <!-- Usuario Logado -->
          
            <a href="javascript:;" title="" class="user-ico clearfix" data-toggle="dropdown"><i class="glyph-icon icon-gears"> </i> 
            	<span>Arthur</span> <i class="glyph-icon icon-chevron-down"></i> </a>
            
                <ul class="dropdown-menu float-right">
                    <li>
                        <a href="Empresa.jsp" title="Eitar o seu Perfil"> <i class="glyph-icon icon-user mrg5R"></i> Empresa </a>
                    </li>
                    
                    <li>
                        <a href="Funcionario-consultar.jsp" title="Editar o Perfil dos Funcionarios"> <i class="glyph-icon icon-cog mrg5R"></i> Funcionários </a>
                    </li>
                    
                    <li>
                        <a href="javascript:;" title="Sair do Sistema"> <i class="glyph-icon icon-signout font-size-13 mrg5R"></i>
                        	<span class="font-bold">Sair</span>  </a>
                   </li>
                </ul>
        </div>
    </div>
       
      
      <!-- ************************ Barra Lado Esquedo - MENU  ************************ -->
      
    <div id="page-sidebar" class="scrollable-content" tabindex="5003" style="overflow: hidden; outline: none; height: 1315px;">
    
        <div id="sidebar-menu" class="active">
        
            
            <ul>
                <li class="current-page"> <a href="Principal.jsp" title="Home"> <i class="glyph-icon icon-home"></i> Home </a> </li>
                
                <li> <a href="Pedidos.jsp" title="Pedidos"> <i class="glyph-icon icon-reorder"></i> Pedidos </a>
                    <ul>
                        <li><a href="#" title="Pedidos atuais"><i class="glyph-icon icon-chevron-right"></i>Atual </a></li>
                        <li><a href="#" title="Pedidos anteriores"><i class="glyph-icon icon-chevron-right"></i> Anteriores </a></li>
                    </ul>
                </li>
                
                <li><a href="javascript:;" title="Relatórios"><i class="glyph-icon icon-bar-chart"></i>Relatórios</a>
                    <ul>
                        <li><a href="Relatorio-fluxo-de-caixa.jsp" title="Relatórios de fluxo de caixa">
                        	<i class="glyph-icon icon-chevron-right"></i>Fluxo de Caixa</a></li>
                            
                        <li><a href="Relatorio-Estatistica-de-pedidos.jsp" title="Estatística de produtos consumidos">
                        	<i class="glyph-icon icon-chevron-right"></i>Estatística de Produtos</a></li>
                            
                        <li><a href="Relatorio-Estatistica-de-consumo.jsp" title="Estatística do periodo de consumo">
                        	<i class="glyph-icon icon-chevron-right"></i>Estatística de Consumo</a></li>
                    </ul>
                </li>
                
                <li><a href="javascript:;" title="Relatórios"><i class="glyph-icon icon-book"></i>Cardápio</a>
                    <ul>
                        <li><a href="Cardapio.jsp" title="Relatórios de fluxo de caixa">
                        	<i class="glyph-icon icon-chevron-right"></i>Produto</a></li>
                            
                        <li><a href="Item.jsp" title="Estatística de produtos consumidos">
                        	<i class="glyph-icon icon-chevron-right"></i>Ingredientes</a></li>
                    </ul>
                </li>
            </ul>
        </div>
	</div>
  </div>
        
  
  
    <!-- # Fim Menu -->
    <div id="page-content-wrapper" style="margin-left: 220px;"><!-- Posicionamento do Conteudo -->
     
      <div id="page-title"> <!-- Sub-Titulo -->
        <h3>
          Funcionários
          <small>
          
          </small>
        </h3>
      </div> <!-- Fim do Sub-Titulo -->
      
       <div id="page-content">
       
       <h3><font>Gerencie seus funcionários</font></h3>
       <div class="form-row"></div>  
       
       <form action="Funcionario" method="post">
      
        <!-- pagina do Conteudo -->
  		<a href="Funcionario-cadastrar.jsp" class="btn bg-green font-size-15 col-md-3 mrg10B " data-original-title="Novo Item">
                            <i class="glyph-icon icon-plus"></i> Novo Funcionário </a>    
                            
		                         
        <div class="form-row"></div>  
        <div class="example-code">
          <table class="table table-striped text-center">
            <thead>
              <tr>
                <th class="text-center">
                </th>
                <th><font>Nome</font></th>
                <th class="text-center"><font>Cargo</font></th>
                <th class="text-center"><font>CPF</font></th>
                <th class="text-center"><font>Ações</font></th>
              </tr>
            </thead>
            
            <tbody>
            
            <%
	    		FuncionarioDAO dao = DAOFactory.obterFuncionarioDao();					
           			List retorno = dao.consultarFuncionario();
					if(retorno != null) {
            			for(Iterator<Funcionario> it = retorno.iterator(); it.hasNext(); ) {
            				Funcionario funcionario = (Funcionario)it.next();	
            %>
            
              <tr>
                <td></td>
                
                <%
                	funcionario.getNmCPF();
                	funcionario.getNmCTPS();
                	funcionario.getNmDataNascimento();
                	funcionario.getNmEndereco();
                	funcionario.getNmNumero();
                	funcionario.getNmSenha();
                	funcionario.getCodCargo();
                %>
                
                <td class="font-bold text-left"><font><%= funcionario.getNmNomeFuncionario() %></font></td>
                <td><div class="font-bold"><font><%= funcionario.getNmCargo() %></font></div></td>
                <td><div class="font-bold"><font><%= funcionario.getNmCPF() %></font></div></td>
                <td>
                  <div class="dropdown">
                    <a href="javascript:;" title="" class="btn medium bg-blue" data-toggle="dropdown">
                                <span class="button-content">
                                    <i class="glyph-icon font-size-11 icon-cog"></i>
                                    <i class="glyph-icon font-size-11 icon-chevron-down"></i>
                                </span>
                            </a>
                    <ul class="dropdown-menu float-right">
                    
                      <form action="ManterFuncionario" method="post">
                      <input type="hidden" name="operacao" value="redirecionarEditarFuncionario">
                      	<input type="hidden" name="funcionario" value="<%= funcionario.getCodFuncionario()%>">
                      	<li><a href="javascript:;" title="">
                       		<input type="button" name="editar" value="Editar" onClick="executar(this.form,'redirecionarEditarFuncionario')">
							</a>
                      	</li>
                      </form>
                      
                      <li class="divider"></li>
                      
                      <form action="ManterFuncionario" method="post">
                      <input type="hidden" name="operacao" value="excluirFuncionario">
	                      <li><button type="submit" name="codFuncionario" value="<%= funcionario.getCodFuncionario()%>"><a href="javascript:;" class="font-red" title="" data-layout="center" data-type="warning">
	                        <i class="glyph-icon icon-remove mrg5R"></i>
	                        	<font>Excluir</font></a></button>
	                      </li>
	                  </form>
                    </ul>
                  </div>
                </td>
              </tr>
             <%
						}
					}
					request.getSession().setAttribute("listaFuncionarios", retorno);		
             %>
              
            </tbody>
          </table>
        </div>
        
      </div>
      </form>
   
    </div>
  </body>

</html>